/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.mongoosehome.web.onlinemall.product.service;

import com.mongoosehome.web.common.domain.TProducts;
import com.mongoosehome.web.onlinemall.product.dao.ProductDao;
import com.mongoosehome.web.util.PageInfo;

/**
 *
 * @author Administrator
 */
public class ProductServiceImpl implements ProductService {
    private ProductDao productDao;

    @Override
    public PageInfo getProductsList(int pageNo,int maxResult,String sortField,String sortDir) {
        return this.productDao.getProductsList(pageNo,maxResult,sortField,sortDir);
    }

    @Override
    public TProducts getProducts(int productId) {
        return this.productDao.getProducts(productId);
    }

    /**
     * @param productDao the productDao to set
     */
    public void setProductDao(ProductDao productDao) {
        this.productDao = productDao;
    }

    @Override
    public void saveProducts(TProducts tProducts) {
        this.productDao.saveProducts(tProducts);
    }
    
    @Override
    public boolean  isProducts(String name){
        return this.productDao.isProducts(name);
    }

    @Override
    public void updateProducts(TProducts tProducts) {
        this.productDao.saveProducts(tProducts);
    }
    
}
